package com.oa.modules.approvalsec1.controller;

import com.oa.common.utils.R;
import com.oa.common.utils.TLSSigAPIv2;
import com.oa.modules.sys.controller.AbstractController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("tencent/cloud")
@Api(tags = "腾讯云相关接口")
public class TencentCloudController extends AbstractController {

    @ResponseBody
    @ApiOperation(value = "获取当前用户签名")
    @PostMapping(value = "/getUserSig")
    public R getUserSig() throws Exception {
        TLSSigAPIv2 api = new TLSSigAPIv2(1400492536, "0ed6019aeb401d32c9b47dbcd0ffd8cc9be20fefea7915b00c9bb2c7f1a12879");
        return R.ok().put("userId",getUserId()).put("userSin",api.genUserSig(getUserId().toString(), 180 * 86400));
    }
}
